(多用于编程与类型系统)不兼容的类型:指两个数据类型在赋值、运算、参数传递或比较时不匹配,编译器/解释器因此报错或警告(例如把字符串当作整数使用,或把指针类型与非指针类型混用)。在不同语言中,“不兼容”的规则与严格程度可能不同。
/ˌɪnkəmˈpætəbəl taɪps/
The compiler says there are incompatible types in this assignment.
编译器提示这次赋值中存在类型不兼容。
Because the function expects a String but you passed an int, the build fails with “incompatible types,” which can be fixed by converting the value first.
因为函数需要的是 String,你却传入了 int,构建就会因“类型不兼容”而失败;先把值转换成合适类型即可修复。
incompatible 来自拉丁语前缀 in-(不)+ compatible(可兼容的,能一起使用的)。compatible 与拉丁语 compatī(一起忍受/共同承受,引申为“能共存、能配合”)有关。types 是 type 的复数,源自希腊语 typos(印记、模子、类型)。合起来在计算机语境中指“无法在同一规则下配合使用的类型”。